ArcGIS Data Reviewer API for JavaScript
Show:

BatchValidationTask Class

Extends _DRSBaseTask

Exposes functions for executing and scheduling Batch Validation in ArcGIS Data Reviewer for Server. Provides functions for managing Batch Validation jobs and information.

Batch Validation operates in two execution modes: adhoc (immediate); scheduled. Adhoc jobs execute immediately and run once. Scheduled jobs run repeatedly according to a schedule and terminate once BatchValidationParameters/maxNumberOfExecutions has been exceeded or BatchValidationParameters/executionEndDate has passed. See BatchValidationParameters.

Constructor

BatchValidationTask

(
  • url
)

Parameters:

  • url String

    The DataReviewerServer Server Object Extension (SOE) URL.

Methods

cancelJobExecution

(
  • jobId
)
Deferred

Cancels an executing job.

Parameters:

  • jobId String

    Job Id of the batch validation job to cancel.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if cancel succeeded or not.

createReviewerSession

() Deferred

Inherited from _DRSBaseTask:

Creates a new Reviewer session. The Reviewer session stores results from check and batch job execution.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds ReviewerSession.

deleteJob

(
  • jobId
)
Deferred

Deletes an existing scheduled Batch Validation Job.

Parameters:

  • jobId String

    Job Id of the batch validation job to delete.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the deleteJob function succeeded or not.

disableJob

(
  • jobId
)
Deferred

Pauses an existing Batch Validation Job's schedule.

Parameters:

  • jobId String

    Job Id of the batch validation job to be disabled.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the disableJob function succeeded or not.

editJob

(
  • jobId
  • parameters
)
Deferred

Edits the schedule, settings and title of an existing Batch Validation Job

Parameters:

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the editJob function succeeded or not.

enableJob

(
  • jobId
)
Deferred

Restarts an existing Batch Validation Job's schedule. Use enableJob to restart a previously disabled job.

Parameters:

  • jobId String

    Job Id of the batch validation job to enable.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object. The response object holds a boolean that indicates if the enableJob function succeeded or not.

executeJob

(
  • parameters
)
Deferred

Executes an adhoc job. Adhoc jobs execute immediately and run once.

See BatchValidationParameters.

Parameters:

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object. The response object holds a jobId String.

getAdhocJobsList

() Deferred

Retrieves all adhoc jobs from the server and returns an array of BatchValidationJobDetails with the information.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object. The response object holds an array of adhocJob IDs.

getJobDetails

(
  • jobId
)
Deferred

Fetches Batch Validation Job details.

Parameters:

  • jobId String

    Job Id of the batch validation job.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an instance of BatchValidationJobDetails.

getJobExecutionDetails

(
  • jobId
)
Deferred

Fetches the Job Execution details of a Batch Validation Job.

Parameters:

  • jobId String

    Job Id of the batch validation job.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an instance of BatchValidationJobExecutionDetails.

getJobIds

() Deferred

Returns an object that contains Scheduled and AdhocJob IDs in two separate arrays.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds two arrays: adhocJob IDs; scheduleJob IDs.

getLifecycleStatusStrings

() Deferred

Inherited from _DRSBaseTask:

Retrieves a list of localized life cycle status strings from the Reviewer workspace. Each Reviewer result stored in the Reviewer workspace has a life cycle status code that matches one of the strings returned from this method execution. Use these strings to replace the numeric code values when displaying a list of Reviewer results to the user.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an array of lifecyclestatus strings.

getReviewerSessions

() Deferred

Inherited from _DRSBaseTask:

Returns an array of sessions in a Reviewer workspace. Access the array through either the deferred object or the onGetReviewerSessionsComplete event.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an array of ReviewerSession.

Example:

            var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
            var dashboardTask=new DashboardTask(url);
            var deferred=dashboardTask.getReviewerSessions();
            deferred.then(function(response)
                {
                    array.forEach(response.reviewerSessions, function(item,i)
                    {
                        document.write("Session name: " + item.sessionName);
                        document.write("<br/>Session Id: " + item.sessionId);
                        document.write("<br/>User name: " + item.userName);
                        document.write("<br/>Version name: " + item.versionName);
                        document.write("<br/>");
                    });
                },
                function(error)
                {
                    document.write("Error occurred: " + error.message);
                }
            );

getScheduledJobsList

() Deferred

Retrieves all scheduled jobs from the server and returns an array of BatchValidationJobDetails with the information.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an array of scheduledJob IDs.

scheduleJob

(
  • parameters
)
Deferred

Schedules a new Batch Validation.

Parameters:

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds a jobId String.

Events

onCancelJobExecutionComplete

Dispatched by cancelJobExecution.

Event Payload:

onCreateReviewerSessionsComplete

Inherited from _DRSBaseTask:

Dispatched by createReviewerSession.

Event Payload:

onDeleteJobComplete

Dispatched by deleteJob.

Event Payload:

onDisableJobComplete

Dispatched by disableJob.

Event Payload:

onEditJobComplete

Dispatched by editJob.

Event Payload:

onEnableJobComplete

Dispatched by enableJob.

Event Payload:

onError

Inherited from _DRSBaseTask:

Event Payload:

Example:

        // connect to the onError event of the task
        function onErrorHandler(error)
        {
           alert ("An error occurred. Error message = " + 
                  error.message +" Error code = " +error.code);
        }

onExecuteJobComplete

Dispatched by executeJob.

Event Payload:

onGetAdhocJobsListComplete

Dispatched by getAdhocJobsList.

Event Payload:

onGetJobDetailsComplete

Dispatched by getJobDetails.

Event Payload:

onGetJobExecutionDetailsComplete

Dispatched by getJobExecutionDetails.

Event Payload:

onGetJobIdsComplete

Dispatched by getJobIds.

Event Payload:

onGetLifecycleStatusStringsComplete

Inherited from _DRSBaseTask:

Dispatched by getLifecycleStatusStrings.

Event Payload:

  • response Object


    Contains:

    • Array lifecycleStatusStrings

onGetReviewerSessionsComplete

Inherited from _DRSBaseTask:

Dispatched by getReviewerSessions.

Event Payload:

onGetScheduledJobsListComplete

Dispatched by getScheduledJobsList.

Event Payload:

onScheduleJobComplete

Dispatched by scheduleJob.

Event Payload: